<?php session_start();
include("authentication.php");
require_once('../includes/conn.php'); 
require_once('../includes/settings.inc.php');
//include("../include/function_cls.php");
//$obj = new Libraries();

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
//if($_POST["publish"]) $publish = 1;
//else $publish = 0;

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) 
{
//echo "dasfsdf";
//$_POST['page_physical_name'] = strtolower($_POST['page_physical_name']);
//if($_POST['robots'] == "noindex, nofollow") $_POST['robots'] = "noindex, nofollow";
//else $_POST['robots'] = "index,follow";
if(isset($_POST['new_page']) && $_POST['new_page'] =="Add New Page")
{
		if($_REQUEST["language"] == 'en')
		{
			if(strstr($_REQUEST["page_physical_name"],".htm"))
			{
				$page_physical_name = $_REQUEST["page_physical_name"];
			}
			else
			{
				$page_physical_name = $_REQUEST["page_physical_name"].".htm";
			}
			
			$s1_max_orderid = "select max(orderid) as orderid from news where 1";
					 $q1_max_orderid = mysql_query($s1_max_orderid) or die($s1_max_orderid);
					 $r1_max_orderid = mysql_fetch_array($q1_max_orderid);
					 $orderid = $r1_max_orderid["orderid"] + 1;
			
			$ndt = explode("/",$_REQUEST["ndate"]);
			$new_dt = $ndt["2"]."-".$ndt["0"]."-".$ndt["1"];
			$SQL = "INSERT INTO `news` ( `nid` , `nhead` , ndetail, title ,`description` , `keywords` , `author` ,ndate , ncrdate , robots , page_physical_name , copyright , ntype,orderid)VALUES (NULL , '".$_REQUEST["heading"]."','".$_REQUEST["description"]."', '".$_REQUEST["heading"]."', '".$_REQUEST["description1"]."', '".$_REQUEST["keywords"]."', '".$_REQUEST["author"]."','".$new_dt."','".date("Y-m-d h:i:s")."','".$_REQUEST["robots"]."', '".$page_physical_name."' , '".$_REQUEST['copyright']."' , '".$_REQUEST['for']."','".$orderid."');";
		
		}
		else
		if($_REQUEST["language"] == 'ja')
		{
			if(strstr($_REQUEST["page_physical_name_ja"],".htm"))
			{
				$page_physical_name = $_REQUEST["page_physical_name_ja"];
			}
			else
			{
				$page_physical_name = $_REQUEST["page_physical_name_ja"].".htm";
			}
			
			$s1_max_orderid = "select max(orderid) as orderid from news where 1";
					 $q1_max_orderid = mysql_query($s1_max_orderid) or die($s1_max_orderid);
					 $r1_max_orderid = mysql_fetch_array($q1_max_orderid);
					 $orderid = $r1_max_orderid["orderid"] + 1;
			
			$ndt = explode("/",$_REQUEST["ndate_ja"]);
			$new_dt = $ndt["2"]."-".$ndt["0"]."-".$ndt["1"];
			$SQL = "INSERT INTO `news` ( `nid` , `nhead_ja` , ndetail_ja, title_ja ,`description_ja` , `keywords_ja` , `author_ja` ,ndate , ncrdate , robots , page_physical_name , copyright_ja , ntype,orderid)VALUES (NULL , '".$_REQUEST["heading_ja"]."','".$_REQUEST["description_ja"]."', '".$_REQUEST["heading_ja"]."', '".$_REQUEST["description1_ja"]."', '".$_REQUEST["keywords_ja"]."', '".$_REQUEST["author_ja"]."','".$new_dt."','".date("Y-m-d h:i:s")."','".$_REQUEST["robots_ja"]."', '".$page_physical_name."' , '".$_REQUEST['copyright_ja']."' , '".$_REQUEST['for']."','".$orderid."');";
		
		}
	
}
else
{
	if($_REQUEST["language"] == 'en')
	{
			if(strstr($_REQUEST["page_physical_name"],".htm"))
			{
				$page_physical_name = $_REQUEST["page_physical_name"];
			}
			else
			{
				$page_physical_name = $_REQUEST["page_physical_name"].".htm";
			}
			$ndt = explode("/",$_REQUEST["ndate"]);
			$new_dt = $ndt["2"]."-".$ndt["0"]."-".$ndt["1"];
			$SQL = "update news set nhead = '".$_REQUEST["heading"]."',title = '".$_REQUEST["heading"]."',ndetail = '".$_REQUEST["description"]."',description = '".$_REQUEST["description1"]."',keywords = '".$_REQUEST["keywords"]."',author = '".$_REQUEST["author"]."',ndate = '".$new_dt."',ncrdate = '".date("Y-m-d h:i:s")."',robots = '".$_REQUEST["robots"]."' , page_physical_name = '".$page_physical_name."', copyright = '".$_REQUEST["copyright"]."', ntype = '".$_REQUEST["for"]."' where nid = '".$_REQUEST["code"]."'";
	}
	else
	if($_REQUEST["language"] == 'ja')
	{
			if(strstr($_REQUEST["page_physical_name_ja"],".htm"))
			{
				$page_physical_name = $_REQUEST["page_physical_name_ja"];
			}
			else
			{
				$page_physical_name = $_REQUEST["page_physical_name_ja"].".htm";
			}
			$ndt = explode("/",$_REQUEST["ndate_ja"]);
			$new_dt = $ndt["2"]."-".$ndt["0"]."-".$ndt["1"];
			$SQL = "update news set nhead_ja = '".$_REQUEST["heading_ja"]."',title_ja = '".$_REQUEST["heading_ja"]."',ndetail_ja = '".$_REQUEST["description_ja"]."',description_ja = '".$_REQUEST["description1_ja"]."',keywords_ja = '".$_REQUEST["keywords_ja"]."',author_ja = '".$_REQUEST["author_ja"]."',ndate = '".$new_dt."',ncrdate = '".date("Y-m-d h:i:s")."',robots = '".$_REQUEST["robots_ja"]."' , page_physical_name = '".$page_physical_name."', copyright_ja = '".$_REQUEST["copyright_ja"]."', ntype = '".$_REQUEST["for"]."' where nid = '".$_REQUEST["code"]."'";
	}
}
  $Result1 = mysql_query($SQL) or die($SQL);
  if(!$Result1)
  {
   	$msg = "Error: ".mysql_error()." - ".mysql_errno();
}
  else
  { 
	 echo "<script language='javascript'>
  		alert('Page saved succesffully!');
    	window.location = '".$_SERVER['HTTP_REFERER']."';
  		</script>";  	
	//header(sprintf("Location: %s", $insertGoTo));
  }//END ELSE	
}

$s_title = "";
$s_detail = "";
// For data retrieval
if(isset($_POST['new_page']) && $_POST['new_page'] =="Add New Page")
{
	echo"";
}
else
{
	$s1 = "select * from news where nid = '".$_REQUEST["code"]."' and ntype = '".$_REQUEST["for"]."'";
		$q1 = mysql_query($s1) or die($s1);
		$row_sel = mysql_fetch_array($q1); 
		$s_title = $row_sel["nhead"];
		$s_detail = $row_sel["ndetail"];
		$s_id = $row_sel["nid"];
		$s_date = date("m/d/Y",strtotime($row_sel["ndate"]));
		$s_description = $row_sel["description"];
		$s_keywords = $row_sel["keywords"];
		$s_author = $row_sel["author"];
		$s_copyright = $row_sel["copyright"];
		$page_physical_name = str_replace(".htm","",$row_sel["page_physical_name"]);
	
}
include("fckeditor/fckeditor.php") ;	
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title><?=$site_name?> - Admin Panel</title>
<META NAME="ROBOTS" CONTENT="NOARCHIVE">
<META NAME="ROBOTS" CONTENT="NOINDEX">
<META NAME="ROBOTS" CONTENT="NOIMAGEINDEX">
<META NAME="ROBOTS" CONTENT="NOFOLLOW">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>

<script language="JavaScript" type="text/JavaScript">
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
	// <![CDATA[
	var myMenu;
	window.onload = function() {
		myMenu = new SDMenu("my_menu");
		myMenu.init();
	};
	// ]]>
	function change_status(type)
	{
		if(type == '1')
		{
			document.getElementById("email_details").style.display = 'inline';
		}
		else
		if(type == '0')
		{
			document.getElementById("email_details").style.display = 'none';
		}
	}
</script>
<script type="text/javascript" src="sdmenu/sdmenu.js"></script>
<script language="javascript" type="text/javascript" src="../include/validate.js"></script>
<script type="text/javascript" src="<?=$path?>js/jsapi.js"></script>
<link href="css/styleer.css" rel="stylesheet" type="text/css">
<link href="css/stylesheet.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="sdmenu/sdmenu.css" />
<link href="<?=$path?>css/viterumCSS.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="<?=$path?>js/globale_jsfile.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
function change_language(typ)
{
	//alert(typ);
	if(typ == 'show_en')
	{
		document.getElementById("show_ja").style.display = "none";
		document.getElementById("show_en").style.display = "none";
		document.getElementById("main_body_ajax_show_post_top").style.display = "inline";
		setTimeout("document.getElementById('main_body_ajax_show_post_top').style.display = 'none';", 2000);
		setTimeout("document.getElementById('show_en').style.display = 'inline';", 2000);
		document.getElementById("language").value = 'en';
	}
	else
	if(typ == 'show_ja')
	{
		document.getElementById("show_ja").style.display = "none";
		document.getElementById("show_en").style.display = "none";
		document.getElementById("main_body_ajax_show_post_top").style.display = "inline";
		setTimeout("document.getElementById('main_body_ajax_show_post_top').style.display = 'none';", 2000);
		setTimeout("document.getElementById('show_ja').style.display = 'inline';", 2000);
		document.getElementById("language").value = 'ja';
	}
	//alert(document.getElementById("language").value);
}
</script>
<script language="javascript" type="text/javascript" src="calender/calendarcontrol.js"></script>
<link href="calender/CalendarControl.css" rel="stylesheet" type="text/css">

</head>

<body>
<table width="987" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="987"><img src="<?=$path?>images/spacer.gif" width="100" height="25" /></td>
  </tr>
  <tr>
    <td><table border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><img src="<?=$path?>images/index_03.gif" width="46" height="57" alt="" /></td>
        <td><img src="<?=$path?>images/index_04.gif" width="895" height="57" alt="" /></td>
        <td><img src="<?=$path?>images/index_05.gif" width="46" height="57" alt="" /></td>
      </tr>
      <tr>
        <td background="<?=$path?>images/index_07.gif"><img src="<?=$path?>images/spacer.gif" width="46" height="100" /></td>
        <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          
          <tr>
            <td align="left" valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="20%" valign="top"><table width="80%"  border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><table width="80%"  border="0" cellspacing="0" cellpadding="0">
                      
                      <tr>
                        <td valign="top"><?php include("leftnavigation.php");?></td>
                      </tr>
                    </table></td>
                  </tr>
                  <tr>
                    <td height="6"><img src="images/spacer.gif" width="1" height="1"></td>
                  </tr>
                  
                  
                </table></td>
                <td width="80%" valign="top"><table width="98%"  border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td height="233" valign="top" class="blueBarborder2"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td height="31" class="blueBarborder"><table width="97%"  border="0" align="center" cellpadding="0" cellspacing="0">
                          <tr>
                            <td class="blackTxt"><?=$site_name?> - Admin Panel</td>
                          </tr>
                        </table></td>
                      </tr>
                      <tr>
                        <td height="202" valign="top" bgcolor="#dbedf1"><table width="98%"  border="0" align="center" cellpadding="0" cellspacing="0">
                          <tr>
                            <td height="8"><img src="images/spacer.gif" width="1" height="1"></td>
                          </tr>
                          <tr>
                            <td>
<?php
if(isset($include_page) && $include_page !=NULL)
 include($include_page);
else
{ 
?>							
			<form name="RTEDemo" action="<?php echo $editFormAction; ?>" method="post" onSubmit="return submitForm();">
                              <table width="98%" align="left">
                                <tr valign="baseline">
                                  <td colspan="3" align="center" nowrap class="Redsmalltext">
								  <strong><?php echo $msg?></strong></td>                                  </tr>
								  
								   <!--<tr valign="baseline">
                                  <td colspan="3" align="center" nowrap class="smalltext"><strong><a href="javascript:change_language('show_en');" class="footerLink">English</a>&nbsp;|&nbsp;<a href="javascript:change_language('show_ja');" class="footerLink">Japanese</a></strong></td></tr>-->
								  <tr valign="baseline">
                                  <td colspan="3" align="left" valign="top" nowrap class="smalltext">&nbsp;</td>
                                  </tr>
								  
								  <tr><td colspan="3"><div id="show_en"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr valign="baseline">
                                  <td width="91" align="left" nowrap class="smalltext"><strong>Create Date:</strong></td>
                                  <td colspan="2">
<input type="text" name="ndate" id="ndate" value="<?php echo $_POST['ndate']?$_POST['ndate']:$s_date!="12/31/1969" && $s_date!="01/01/1970"?$s_date:date('m/d/Y');?>" size="12" onclick="showCalendarControl(document.getElementById('ndate'));"  readonly="true">                                  </td>
                                </tr>
								  <tr valign="baseline">
                                  <td colspan="3" align="left" valign="top" nowrap class="smalltext">&nbsp;</td>
                                  </tr>
								  <tr valign="baseline">
                                  <td width="91" align="left" nowrap class="smalltext"><strong>Page Name:</strong></td>
                                  <td colspan="2">
<input type="text" name="page_physical_name" id="page_physical_name" value="<?php echo $_POST['page_physical_name']?$_POST['page_physical_name']:$page_physical_name;?>" size="75" maxlength="255"><span>.htm</span>                                  </td>
                                </tr>
								  <tr valign="baseline">
                                  <td colspan="3" align="left" valign="top" nowrap class="smalltext">&nbsp;</td>
                                  </tr>
                                <tr valign="baseline">
                                  <td width="91" align="left" nowrap class="smalltext"><strong>Title:</strong></td>
                                  <td colspan="2">
<input type="text" name="heading" value="<?php echo $_POST['heading']?$_POST['heading']:$s_title;?>" size="75" onKeyUp="keyup(this,'txttitle');">                                  </td>
                                </tr>
                                <tr valign="baseline">
                                  <td colspan="3" align="left" valign="top" nowrap class="smalltext">&nbsp;</td>
                                  </tr>
                                <tr valign="baseline">
                                  <td align="right" valign="top" nowrap class="smalltext">&nbsp;</td>
                                  <td width="286" align="left" valign="top" nowrap class="smalltext"><span class="Redsmalltext">&gt;&gt;</span> Description for Site Map and Meta Tags<br>
                                    <textarea name="description1" cols="32" rows="5" id="description1"><?php echo $_POST['description1']?$_POST['description1']:$s_description;?></textarea></td>
                                  <td width="251" align="left" valign="top" nowrap class="smalltext"><span class="Redsmalltext">&gt;&gt;</span> Keywords for this page<br>
                                    <textarea name="keywords" cols="22" rows="5" id="keywords"><?php echo $_POST['keywords']?$_POST['keywords']:$s_keywords;?></textarea></td>
                                </tr>
                                <tr valign="baseline">
                                  <td colspan="3" align="left" valign="top" nowrap class="smalltext"><strong>Robots : </strong></td>
                                  </tr>
                                <tr valign="baseline">
                                  <td align="right" valign="top" nowrap class="smalltext">&nbsp;</td>
                                  <td width="286" align="left" valign="top" nowrap class="smalltext"><b>Index</b>&nbsp;<input  <?php if ($row_sel['robots']=="index,nofollow") {echo "checked=\"checked\"";} ?> name="robots" type="radio" value="index,nofollow" />&nbsp;&nbsp;&nbsp;&nbsp;<b>Follow</b>&nbsp;<input   <?php if ($row_sel['robots']=="noindex,follow") {echo "checked=\"checked\"";} ?> name="robots" type="radio" value="noindex,follow" />&nbsp;&nbsp;&nbsp;&nbsp;<b>Disallow</b>&nbsp;<input  <?php if ($row_sel['robots']=="noindex,nofollow") {echo "checked=\"checked\"";} ?> name="robots" type="radio" value="noindex,nofollow" />&nbsp;&nbsp;&nbsp;&nbsp;<b>Allow</b>&nbsp;<input  <?php if ($row_sel['robots']=="index,follow") {echo "checked=\"checked\"";} ?> name="robots" type="radio" value="index,follow" /></td>
                                  <td width="251" align="left" valign="top" nowrap class="smalltext">&nbsp;</td>
                                </tr>
								<tr valign="baseline">
                                  <td colspan="3" align="left" valign="top" nowrap class="smalltext">&nbsp;</td>
                                  </tr>
                                <tr valign="baseline">
                                  <td colspan="3" align="left" valign="top" nowrap class="smalltext"><strong>Description:</strong></td>
                                  </tr>
								  <tr valign="baseline">
                                  <td colspan="3" align="left" valign="top" nowrap class="smalltext">&nbsp;</td>
                                  </tr>
                                <tr valign="baseline">
                                  <td colspan="3" align="center" valign="top" nowrap class="smalltext">
                                    <?php
if ($_REQUEST["vu"] == "Add New Page") 
{
	//$content = "here's the " . chr(13) . "\"preloaded <b>content</b>\"";
	$content = "";
} 
else
{									
	//format content for preloading
	if (!(isset($_POST["description"]))) {
		//$content = "here's the " . chr(13) . "\"preloaded <b>content</b>\"";
		$content = $s_detail;
	}
	
	else 
	{
		//retrieve posted value
		$content = $_POST["description"];
	}
}
// Automatically calculates the editor base path based on the _samples directory.
// This is usefull only for these samples. A real application should use something like this:
// $oFCKeditor->BasePath = '/fckeditor/' ;	// '/fckeditor/' is the default value.
//$sBasePath = $_SERVER['PHP_SELF'] ;
//$sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "_samples" ) ) ;

$oFCKeditor = new FCKeditor('description') ;
$oFCKeditor->BasePath	= "fckeditor/" ;
//$oFCKeditor->Width		= "20%" ;
$oFCKeditor->Height		= 700 ;
$oFCKeditor->Value		= $content ;
$oFCKeditor->Create() ;
?>									</td>
                                  </tr>
                                <tr valign="baseline">
                                  <td align="left" valign="top" nowrap class="smalltext">&nbsp;</td>
                                  <td colspan="2">&nbsp;</td>
                                </tr>
                                <tr valign="baseline">
                                  <td align="left" nowrap class="smalltext"><strong>Author:</strong></td>
                                  <td colspan="2"><input type="text" name="author" value="<?php echo $_POST['author']?$_POST['author']:$s_author;?>" size="32"></td>
                                </tr>
								<tr valign="baseline">
                                  <td align="left" valign="top" nowrap class="smalltext">&nbsp;</td>
                                  <td colspan="2">&nbsp;</td>
                                </tr>
                                <tr valign="baseline">
                                  <td align="left" nowrap class="smalltext"><strong>Copyright : </strong></td>
                                  <td colspan="2"><input type="text" name="copyright" value="<?php echo $_POST['copyright']?$_POST['copyright']:$s_copyright;?>" size="32"></td>
                                </tr>
                                <tr valign="baseline">
                                  <td colspan="3" align="left" valign="top" nowrap class="smalltext">&nbsp;</td>
                                  </tr>
</table></div><div id="show_ja" style="display:none;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr valign="baseline">
                                  <td width="91" align="left" nowrap class="smalltext">&#20316;&#25104;&#26085;&#65306; </td>
                                  <td colspan="2">
<input type="text" name="ndate_ja" id="ndate_ja" value="<?php echo $_POST['ndate_ja']?$_POST['ndate_ja']:$s_date!="12/31/1969" && $s_date!="01/01/1970"?$s_date:date('m/d/Y');?>" size="12" onclick="showCalendarControl(document.getElementById('ndate_ja'));"  readonly="true">                                  </td>
                                </tr>
								  <tr valign="baseline">
                                  <td colspan="3" align="left" valign="top" nowrap class="smalltext">&nbsp;</td>
                                  </tr>
								  <tr valign="baseline">
                                  <td width="91" align="left" nowrap class="smalltext">&#12506;&#12540;&#12472;&#21517;&#65306; </td>
                                  <td colspan="2">
<input type="text" name="page_physical_name_ja" id="page_physical_name_ja" value="<?php echo $_POST['page_physical_name_ja']?$_POST['page_physical_name_ja']:$page_physical_name;?>" size="75" maxlength="255"><span>.htm</span>                                  </td>
                                </tr>
								  <tr valign="baseline">
                                  <td colspan="3" align="left" valign="top" nowrap class="smalltext">&nbsp;</td>
                                  </tr>
                                <tr valign="baseline">
                                  <td width="91" align="left" nowrap class="smalltext">&#12479;&#12452;&#12488;&#12523;&#65306; </td>
                                  <td colspan="2">
<input type="text" name="heading_ja" value="<?php echo $_POST['heading_ja']?$_POST['heading_ja']:$row_sel["nhead_ja"];?>" size="75">                                  </td>
                                </tr>
                                <tr valign="baseline">
                                  <td colspan="3" align="left" valign="top" nowrap class="smalltext">&nbsp;</td>
                                  </tr>
                                <tr valign="baseline">
                                  <td align="right" valign="top" nowrap class="smalltext">&nbsp;</td>
                                  <td width="286" align="left" valign="top" nowrap class="smalltext"><span class="Redsmalltext">&gt;&gt;</span>&#22320;&#22259;&#12434;&#34920;&#31034;&#12469;&#12452;&#12488;&#12510;&#12483;&#12503;&#12395;<br>
                                    <textarea name="description1_ja" cols="32" rows="5" id="description1_ja"><?php echo $_POST['description1_ja']?$_POST['description1_ja']:$row_sel["description_ja"];?></textarea></td>
                                  <td width="251" align="left" valign="top" nowrap class="smalltext"><span class="Redsmalltext">&gt;&gt;</span>&#22320;&#22259;&#12434;&#34920;&#31034;&#12501;&#12483;&#12479;&#12540;] <br>
                                    <textarea name="keywords_ja" cols="22" rows="5" id="keywords_ja"><?php echo $_POST['keywords_ja']?$_POST['keywords_ja']:$row_sel["keywords_ja"];;?></textarea></td>
                                </tr>
                                <tr valign="baseline">
                                  <td colspan="3" align="left" valign="top" nowrap class="smalltext">&#12525;&#12508;&#12483;&#12488;&#65306; </td>
                                  </tr>
                                <tr valign="baseline">
                                  <td align="right" valign="top" nowrap class="smalltext">&nbsp;</td>
                                  <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="left" valign="top" nowrap class="smalltext">&#30446;&#27425;
  <input   <?php if (!(strcmp($row_sel['robots'],"index,nofollow"))) {echo "checked=\"checked\"";} ?> name="robots_ja" type="radio" value="index,nofollow" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &#12316;&#12395;&#24467;&#12358;  &nbsp;&nbsp;
  <input   <?php if (!(strcmp($row_sel['robots'],"noindex,follow"))) {echo "checked=\"checked\"";} ?> name="robots_ja" type="radio" value="noindex,follow" />&nbsp;&nbsp;&nbsp;&nbsp;  &#35377;&#21487;&#12375;&#12394;&#12356;  &nbsp;
  <input  <?php if (!(strcmp($row_sel['robots'],"noindex,nofollow"))) {echo "checked=\"checked\"";} ?> name="robots_ja" type="radio" value="noindex,nofollow" />&nbsp;&nbsp;&nbsp;&nbsp;  &#35377;&#21487;&#12377;&#12427;
  <input  <?php if (!(strcmp($row_sel['robots'],"index,follow"))) {echo "checked=\"checked\"";} ?> name="robots_ja" type="radio" value="index,follow" /></td></tr>
</table></td>
                                </tr>
								<tr valign="baseline">
                                  <td colspan="3" align="left" valign="top" nowrap class="smalltext">&nbsp;</td>
                                  </tr>
                                <tr valign="baseline">
                                  <td colspan="3" align="left" valign="top" nowrap class="smalltext"><strong>&#12467;&#12531;&#12486;&#12531;&#12484;&#12398;&#12486;&#12461;</strong></td>
                                  </tr>
								  <tr valign="baseline">
                                  <td colspan="3" align="left" valign="top" nowrap class="smalltext">&nbsp;</td>
                                  </tr>
                                <tr valign="baseline">
                                  <td colspan="3" align="center" valign="top" nowrap class="smalltext">
                                    <?php
if ($_REQUEST["vu"] == "Add New Page") 
{
	//$content = "here's the " . chr(13) . "\"preloaded <b>content</b>\"";
	$content = "";
} 
else
{									
	//format content for preloading
	if (!(isset($_POST["description_ja"]))) {
		//$content = "here's the " . chr(13) . "\"preloaded <b>content</b>\"";
		$content =$row_sel["ndetail_ja"];
	}
	
	else 
	{
		//retrieve posted value
		$content = $_POST["description_ja"];
	}
}
// Automatically calculates the editor base path based on the _samples directory.
// This is usefull only for these samples. A real application should use something like this:
// $oFCKeditor->BasePath = '/fckeditor/' ;	// '/fckeditor/' is the default value.
//$sBasePath = $_SERVER['PHP_SELF'] ;
//$sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "_samples" ) ) ;

$oFCKeditor = new FCKeditor('description_ja') ;
$oFCKeditor->BasePath	= "fckeditor/" ;
$oFCKeditor->Config['AutoDetectLanguage'] = false ;
$oFCKeditor->Config['DefaultLanguage'] = 'ja' ;
$oFCKeditor->Height		= 700 ;
$oFCKeditor->Value		= $content ;
$oFCKeditor->Create() ;
?>									</td>
                                  </tr>
                               <tr valign="baseline">
                                  <td align="left" valign="top" nowrap class="smalltext">&nbsp;</td>
                                  <td colspan="2">&nbsp;</td>
                                </tr>
                                <tr valign="baseline">
                                  <td align="left" nowrap class="smalltext">&#33879;&#32773;&#65306; </td>
                                  <td colspan="2"><input type="text" name="author_ja" value="<?php echo $_POST['author_ja']?$_POST['author_ja']:$row_sel['author_ja'];?>" size="32"></td>
                                </tr>
								<tr valign="baseline">
                                  <td align="left" valign="top" nowrap class="smalltext">&nbsp;</td>
                                  <td colspan="2">&nbsp;</td>
                                </tr>
                                <tr valign="baseline">
                                  <td align="left" nowrap class="smalltext">&#33879;&#20316;&#27177;&#65306; </td>
                                  <td colspan="2"><input type="text" name="copyright_ja" value="<?php echo $_POST['copyright_ja']?$_POST['copyright_ja']:$row_sel['copyright_ja'];?>" size="32"></td>
                                </tr>
                                <tr valign="baseline">
                                  <td colspan="3" align="left" valign="top" nowrap class="smalltext">&nbsp;</td>
                                  </tr>
</table></div></td></tr>
								  <tr><td colspan="3" valign="middle"><div id="main_body_ajax_show_post_top" style="display:none; vertical-align:middle"><p align="center" class="allLink">Loading...</p><p align="center"><img src="<?=$path?>images/ajax_loader.gif" /></p></div></td></tr>
                                <tr valign="baseline">
                                  <td nowrap align="right">&nbsp;</td>
                                  <td colspan="2">
								  <input name="submit" type="submit" value="Save Page">
								  <input name="language" type="hidden" id="language" value="en">
								  <input name="for" type="hidden" id="for" value="<?php echo $_REQUEST['for']?>" />
             					  <input name="code" type="hidden" id="code" value="<?php echo $_REQUEST['code']?>" />
              					  <input name="new_page" type="hidden" id="new_page" value="<?php echo $_REQUEST['vu']?>" />			  </td>
                                </tr>
                              </table>
                              <input type="hidden" name="MM_insert" value="form1">
                            </form>
							<?php
							}
							?>							</td>
                          </tr>
                        </table></td>
                      </tr>
                    </table></td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
          </tr>
         </table></td>
        <td background="<?=$path?>images/index_21.gif"><img src="<?=$path?>images/spacer.gif" width="46" height="100" /></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><img src="<?=$path?>images/index_41.gif" width="987" height="52" alt="" /></td>
  </tr>
</table>
</body>
</html>

